package com.sdp.core.bizc.exception;

public class ExceptionMessage {

	public static String getExceptionMessage(Exception e) {
		StringBuffer strbuff = new StringBuffer();
		for (StackTraceElement stet : e.getStackTrace()) {
			strbuff.append(stet + "\n");
		}
		return e.getClass().getName() + ":" + e.getMessage() + "\n\t" + strbuff.toString();
	}
	
	public static String getSubStrExceptionMessage(Exception e) {
		StringBuffer strbuff = new StringBuffer();
		for (StackTraceElement stet : e.getStackTrace()) {
			strbuff.append(stet + "\n");
		}
		String mes = strbuff.toString();
		if(mes.length()>3000) {
			mes = mes.substring(0,3000)+"......";
		}
		return e.getClass().getName() + ":" + e.getMessage() + "\n\t" + mes;
	}
	
}
